/**
 * Creat by TanLei
 * Description:
 * User:86183
 * Date:2022-05-11
 * Time:12:19
 */
public class Demo9 extends Thread{
    public static void main(String[] args) {
        Thread thread = new Thread(()->{
            while (true){
                System.out.println("hello thread");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        },"mythread");

        thread.start();

        while (true){
            System.out.println("hello main");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

    }
}
